package kr.co.doriclassic.powerjava.chapter06;

public class GuguDanFor {
	public static void main(String[] args) {
		
		/*for(int i=2;i<10;i++){
			calGuguDan(i);
		}*/
		//calGuguDan(5);
		//calGuguDan();
		//calFact(5);
		prnStar();
		prnStar2();
		prnStar4();
	}

	private static void prnStar4() {
		/*for(int i=0;i<6;i++){
			for(int j=5;j>i;j--){
				System.out.print(" ");
			}
			for(int k=0;k<i;k++){
				System.out.print("*");
			}
			System.out.println();
		}*/
		for(int i=6;i>0;i--){
			for(int j=0;j<(i-1);j++){
				System.out.print(" ");
			}
			for(int k=6;k>i;k--){
				System.out.print("*");
			}
			System.out.println();
		}
	}

	private static void prnStar2() {
		for(int i=0;i<5;i++){
			for(int j=0;j<(i+1);j++)
				System.out.print("*");
			
			System.out.println();
		}		
	}

	private static void prnStar() {
	for(int j=0;j<10;j++){
		for(int i=0;i<10;i++){
			System.out.print("*");
		}
		System.out.println();
	}
		/*	for(int i=0;i<10;i++){
			System.out.print("*");
		}*/
		
	}

	private static void calFact(int i) {
		int fact = 1;
		
		for(int j=1;j<i+1;j++){
			fact = fact * j;
		}
		System.out.println(fact);
	}

	private static void calGuguDan() {
		for(int dan=2;dan<10;dan++){
			for(int i=1;i<10;i++){
				System.out.printf("%2d  X %2d  = %2d%n",dan,i,dan*i);
			}		
			System.out.println();
		}
	}

	private static void calGuguDan(int dan) {
		for(int i=1;i<10;i++){
			if(i==5)continue;
			System.out.printf("%2d  X %2d  = %2d%n",dan,i,dan*i);
			
		}
		System.out.println();
	}		
}